Data import and tables
## Loading BG.library
## Adding files missing in collate: addBGpoints.R, addBGpoints_ly.R, addBolusPoints_ly.R, addFasting_ly.R, addPercentBG_ly.R, addPumpSetting_ly.R, addStackbar_ly.R, barSubPlot_ly.R, boxPlot.R, breakStr.R, createSavedPlot.R, dataImport.R, executeSavedPlot.R, findCodeStr.R, heatMap.R, makeLayout.R, makeXaxis.R, makeYaxes.R, makeYaxesSetting.R, makeYaxesSummary.R, makeYdomain.R, plotLine_ly.R, setTimeStep.R, subsetData.R, summaryLinePlot_ly.R, summaryPlotDay_ly.R, summaryPlotHour_ly.R, summaryPlot_ly.R, timeDayTable.R, uniqueDateTime.R, xTicks.R
BGvalue_Summary
## time3 min mean max sd
## 1 00:00 114 114.0000 114 0.000000
## 2 01:00 Inf NaN -Inf NaN
## 3 02:00 Inf NaN -Inf NaN
## 4 03:00 Inf NaN -Inf NaN
## 5 04:00 Inf NaN -Inf NaN
## 6 05:00 273 273.0000 273 NaN
## 7 06:00 166 201.0000 236 40.414519
## 8 07:00 73 104.5000 115 21.000000
## 9 08:00 73 73.0000 73 NaN
## 10 09:00 Inf NaN -Inf NaN
## 11 10:00 189 189.0000 189 NaN
## 12 11:00 274 274.0000 274 NaN
## 13 12:00 60 158.5000 257 113.738003
## 14 13:00 153 153.0000 153 0.000000
## 15 14:00 313 313.0000 313 0.000000
## 16 15:00 102 128.3333 181 45.610671
## 17 16:00 66 72.0000 84 10.392305
## 18 17:00 61 74.6000 95 14.223220
## 19 18:00 Inf NaN -Inf NaN
## 20 19:00 289 289.0000 289 NaN
## 21 20:00 63 101.6667 132 35.246749
## 22 21:00 63 63.0000 63 NaN
## 23 22:00 Inf NaN -Inf NaN
## 24 23:00 156 161.3333 172 9.237604
BGvalue_SummaryDaily
## Date2 min mean max sd
## 1 2019-09-23 89 172.3077 216 41.66810
## 2 2019-09-24 66 132.7273 229 58.99337
## 3 2019-09-25 73 168.4000 313 102.77938
## 4 2019-09-26 61 136.7500 274 70.64347
## 5 2019-09-27 63 152.6667 289 68.50617
## 6 2019-09-28 60 109.0000 273 69.55573
## 7 2019-09-29 Inf NaN -Inf NaN
Sensorvalue_Summary
## time3 min mean max sd
## 1 00:00 78 129.05556 204 42.03532
## 2 01:00 80 145.22222 239 60.15462
## 3 02:00 81 144.63889 215 45.02073
## 4 03:00 106 156.88889 197 20.44194
## 5 04:00 131 162.55556 210 25.59067
## 6 05:00 122 165.94444 241 41.47698
## 7 06:00 102 171.77778 270 60.62678
## 8 07:00 57 129.44444 211 48.24962
## 9 08:00 40 116.94444 246 83.23013
## 10 09:00 93 164.30556 236 52.79601
## 11 10:00 133 208.37209 272 44.76128
## 12 11:00 50 181.62500 309 83.13220
## 13 12:00 40 154.37209 300 95.29154
## 14 13:00 124 213.00000 275 52.41385
## 15 14:00 133 210.91667 311 60.20507
## 16 15:00 62 126.63889 216 41.99806
## 17 16:00 43 70.83333 119 18.77765
## 18 17:00 45 100.66667 172 37.02123
## 19 18:00 109 136.19444 172 20.62705
## 20 19:00 73 146.97143 264 47.77674
## 21 20:00 81 155.62500 287 73.78544
## 22 21:00 67 123.58333 218 45.83347
## 23 22:00 86 135.16667 186 25.82966
## 24 23:00 113 137.94444 183 22.89472
BGHigh_Count
## time3 BG.Reading..mg.dL.
## 1 05:00 1
## 2 06:00 4
## 3 10:00 1
## 4 11:00 1
## 5 12:00 2
## 6 13:00 2
## 7 14:00 2
## 8 15:00 1
## 9 19:00 1
## 10 23:00 3
BGveryHigh_Count
## time3 BG.Reading..mg.dL.
## 1 14:00 2
BGLow_Count
## time3 BG.Reading..mg.dL.
## 1 07:00 1
## 2 08:00 1
## 3 12:00 2
## 4 16:00 2
## 5 17:00 4
## 6 20:00 1
## 7 21:00 1
BGgood_Count
## time3 BG.Reading..mg.dL.
## 1 00:00 2
## 2 07:00 3
## 3 15:00 2
## 4 16:00 1
## 5 17:00 1
## 6 20:00 2
tempBasal_count
## time3 Temp.Basal.Amount
## 1 13:00 1
suspendBasal_Count
## time3 Alarm
## 1 00:00 2
## 2 01:00 2
## 3 07:00 3
## 4 08:00 3
## 5 11:00 3
## 6 12:00 3
## 7 15:00 3
## 8 16:00 6
## 9 17:00 6
## 10 19:00 1
## 11 20:00 2
BGvalue_timeDaytable
## time 2019-09-25 2019-09-26 2019-09-27 2019-09-28 2019-09-29 mean
## 1 00:00 NaN NaN NaN 114.00000 NaN 114.00000
## 2 01:00 NaN NaN NaN NaN NaN NaN
## 3 02:00 NaN NaN NaN NaN NaN NaN
## 4 03:00 NaN NaN NaN NaN NaN NaN
## 5 04:00 NaN NaN NaN NaN NaN NaN
## 6 05:00 NaN NaN NaN 273.00000 NaN 273.00000
## 7 06:00 NaN NaN 201.0000 NaN NaN 201.00000
## 8 07:00 73.0000 115.0 NaN NaN NaN 94.00000
## 9 08:00 73.0000 NaN NaN NaN NaN 73.00000
## 10 09:00 NaN NaN NaN NaN NaN NaN
## 11 10:00 NaN NaN 189.0000 NaN NaN 189.00000
## 12 11:00 NaN 274.0 NaN NaN NaN 274.00000
## 13 12:00 257.0000 NaN NaN 60.00000 NaN 158.50000
## 14 13:00 NaN NaN 153.0000 NaN NaN 153.00000
## 15 14:00 313.0000 NaN NaN NaN NaN 313.00000
## 16 15:00 102.0000 181.0 NaN NaN NaN 141.50000
## 17 16:00 84.0000 NaN 66.0000 NaN NaN 75.00000
## 18 17:00 NaN 61.0 NaN 83.66667 NaN 72.33333
## 19 18:00 NaN NaN NaN NaN NaN NaN
## 20 19:00 NaN NaN 289.0000 NaN NaN 289.00000
## 21 20:00 110.0000 NaN 97.5000 NaN NaN 103.75000
## 22 21:00 NaN NaN 63.0000 NaN NaN 63.00000
## 23 22:00 NaN NaN NaN NaN NaN NaN
## 24 23:00 NaN 172.0 156.0000 NaN NaN 164.00000
## 25 mean 144.5714 160.6 151.8125 132.66667 NaN 147.41265
#heatmap
heatMap(BGvalue_timeDaytable, hasTotals = TRUE,
margins = c(6,20), brks = seq(0,450,50),
brewerPallete = "RdBu")
Sensorvalue_timeDaytable
## time 2019-09-25 2019-09-26 2019-09-27 2019-09-28 2019-09-29 mean
## 1 00:00 113.66667 183.50000 NaN 90.00000 NaN 129.05556
## 2 01:00 124.66667 225.25000 NaN 85.75000 NaN 145.22222
## 3 02:00 144.58333 198.16667 NaN 91.16667 NaN 144.63889
## 4 03:00 150.58333 175.58333 NaN 144.50000 NaN 156.88889
## 5 04:00 146.50000 145.41667 NaN 195.75000 NaN 162.55556
## 6 05:00 145.08333 130.58333 NaN 222.16667 NaN 165.94444
## 7 06:00 150.00000 113.08333 NaN 252.25000 NaN 171.77778
## 8 07:00 97.50000 98.58333 NaN 192.25000 NaN 129.44444
## 9 08:00 68.41667 50.75000 NaN 231.66667 NaN 116.94444
## 10 09:00 125.83333 137.41667 NaN 229.66667 NaN 164.30556
## 11 10:00 227.58333 251.08333 165.14286 171.66667 NaN 203.86905
## 12 11:00 243.41667 276.08333 105.00000 102.00000 NaN 181.62500
## 13 12:00 231.00000 292.00000 78.58333 73.25000 NaN 168.70833
## 14 13:00 262.41667 NaN 140.30000 224.16667 NaN 208.96111
## 15 14:00 285.33333 NaN 147.08333 200.33333 NaN 210.91667
## 16 15:00 124.58333 NaN 103.75000 151.58333 NaN 126.63889
## 17 16:00 68.91667 NaN 57.16667 86.41667 NaN 70.83333
## 18 17:00 86.16667 NaN 131.41667 84.41667 NaN 100.66667
## 19 18:00 135.25000 NaN 158.50000 114.83333 NaN 136.19444
## 20 19:00 95.25000 NaN 195.09091 154.58333 NaN 148.30808
## 21 20:00 104.25000 112.91667 NaN 264.25000 112 148.35417
## 22 21:00 76.91667 115.16667 NaN 178.66667 NaN 123.58333
## 23 22:00 122.00000 118.33333 NaN 165.16667 NaN 135.16667
## 24 23:00 121.66667 166.91667 NaN 125.25000 NaN 137.94444
## 25 mean 143.81597 164.16667 128.20338 159.65625 112 141.56845
#heatmap
heatMap(Sensorvalue_timeDaytable, hasTotals = TRUE,
margins = c(6,20), brks = seq(0,450,50),
brewerPallete = "RdBu")
carbs_timeDaytable
## time 2019-09-25 2019-09-26 2019-09-27 2019-09-28 2019-09-29 max
## 1 00:00 0 0 0 18 NA 18
## 2 01:00 0 0 NA 0 NA 0
## 3 02:00 0 0 0 0 NA 0
## 4 03:00 0 0 0 0 NA 0
## 5 04:00 0 0 NA 0 NA 0
## 6 05:00 0 0 NA 0 NA 0
## 7 06:00 17 0 0 0 NA 17
## 8 07:00 0 20 10 0 NA 20
## 9 08:00 0 0 0 20 NA 20
## 10 09:00 10 0 0 0 NA 10
## 11 10:00 0 0 0 0 NA 0
## 12 11:00 0 30 0 0 NA 30
## 13 12:00 0 0 0 0 NA 0
## 14 13:00 0 0 20 25 NA 25
## 15 14:00 40 0 0 20 NA 40
## 16 15:00 0 10 0 45 NA 45
## 17 16:00 0 0 0 0 NA 0
## 18 17:00 30 0 14 0 NA 30
## 19 18:00 0 0 0 0 NA 0
## 20 19:00 0 0 12 30 NA 30
## 21 20:00 0 0 30 0 0 30
## 22 21:00 0 21 0 0 NA 21
## 23 22:00 28 20 50 50 NA 50
## 24 23:00 0 5 20 0 NA 20
## 25 max 40 30 50 50 0 50
heatMap(carbs_timeDaytable, hasTotals = TRUE,
margins = c(6,15), brks = seq(0,100,10),
brewerPallete = "RdBu", textCol = "deeppink")
plotLine(allData, numberDays = numberDays, scatterOnly = TRUE,addSensor = FALSE,
plotSummary ="",
addBolusType = c("BWZ.Correction.Estimate..U."),
addSetting = c("basal"),
legendInset = -0.35, margins = c(10,4,3,15))
plotLine(allData, numberDays = numberDays, addSensor = TRUE,
colorPalleteDaily = "rainbow",plotSummary ="",
addBolus = FALSE,addSetting = "",
legendInset = -0.35, margins = c(10,4,3,15))
plotLine(allData, numberDays = numberDays, addSensor = FALSE,
colorPalleteDaily = "rainbow", plotSummary = "BG.Reading..mg.dL.",
addSetting = c("basal","corrFactor","carbRatio"), addBolus = FALSE,
legendInset = -0.35, margins = c(10,4,3,15))
plotLine(allData, numberDays = numberDays, addSensor = FALSE,
colorPalleteDaily = "rainbow",plotSummary ="Sensor.Glucose..mg.dL.",
addBolusType = c("Bolus.Volume.Delivered..U."),
addSetting = c("basal"),
legendInset = -0.35, margins = c(10,4,3,15))
plotLine(allData, numberDays = numberDays, addSensor = FALSE,
colorPalleteDaily = "rainbow",plotSummary ="Sensor.Glucose..mg.dL.",
addBolusType = "",addBolus = FALSE,
addSetting = c("basal","corrFactor","carbRatio"),
legendInset = -0.35, margins = c(10,4,3,15))
barPlot(allData, basal, corrFactor,carbRatio,
numberDays = numberDays, plotSummary = "BG.Reading..mg.dL.", sumFunc = "mean", stackedBar = "",
addBG = TRUE, addSetting = c("basal","corrFactor","carbRatio"),
legendInset = -0.35, margins = c(10,4,2,15))
barPlot(allData, basal, corrFactor,carbRatio,
numberDays = numberDays, plotSummary = "BG.Reading..mg.dL.", sumFunc = "mean", stackedBar = "BGrange",
addBG = FALSE, addSetting = c("basal","corrFactor","carbRatio"),
legendInset = -0.35, margins = c(10,4,2,15))
barPlot(allData, basal, corrFactor,carbRatio,
numberDays = numberDays, plotSummary = "BG.Reading..mg.dL.", sumFunc = "mean", stackedBar = "insulin",
addBG = FALSE, addSetting = c("corrFactor","carbRatio"),
legendInset = -0.35, margins = c(10,4,2,15))
barPlot(allData, basal, corrFactor,carbRatio,
filterCond = "data[data$BG.Reading..mg.dL.>150 & !is.na(data$BG.Reading..mg.dL.),]",
numberDays = numberDays, plotSummary = "BG.Reading..mg.dL.", sumFunc = "length", stackedBar = "",
addBG = TRUE, addSetting = c("basal","corrFactor","carbRatio"),
legendInset = -0.35, margins = c(10,4,2,15))
barPlot(allData, basal, corrFactor,carbRatio,
filterCond = "data[data$BG.Reading..mg.dL.<80 & !is.na(data$BG.Reading..mg.dL.),]",
numberDays = numberDays, plotSummary = "BG.Reading..mg.dL.", sumFunc = "length", stackedBar = "",
addBG = TRUE, addSetting = c("basal","corrFactor","carbRatio"),
legendInset = -0.35, margins = c(10,4,2,15))
#boxplots
boxPlot(allData,basal, corrFactor,carbRatio, numberDays = numberDays, filterCond = "",
plotSummary = "BWZ.Carb.Input..grams.",
addSetting = "",
legendInset = -0.3, margins = c(10,4,2,15))
boxPlot(allData,basal, corrFactor,carbRatio, numberDays = numberDays, filterCond = "",
plotSummary = "BG.Reading..mg.dL.",
addSetting ="basal",
legendInset = -0.3, margins = c(10,4,2,15))